package pl.edu.pw.perg.compinfodb.entities.utils;

import java.util.Comparator;

import pl.edu.pw.perg.compinfodb.entities.Connector;

public class ConnectorComparator implements Comparator<Connector> {

	private boolean input;
	
	public ConnectorComparator(boolean input){
		this.input = input;
	}
	public int compare(Connector o1, Connector o2) {
		
		return input? o1.getPositionIn() - o2.getPositionIn() :
			o1.getPositionOut() - o2.getPositionOut();
	}

}
